#pragma once

#include <cv.h>
#include <list>
#include <string>

class OCREngine
{
	bool m_init;

	typedef std::pair<IplImage*, int> t_imgmember;
	typedef std::list< t_imgmember > t_imglist;
	t_imglist m_db;

	unsigned long computeSquareError (IplImage* one, IplImage* two) const;

	OCREngine(void);
	~OCREngine(void);
public:
	static OCREngine *instance (void) {
		static OCREngine eng;
		return &eng;
	}

	bool init (const std::string &digitdir);
	int identify (const IplImage* digit) const;
};
